            <h3 class="box-title ">
              菜品信息 
              <%= link_to("新增菜品", "/restaurants/foods/new" , class:"btn btn-info btn-rounded pull-right") %> 
            </h3>
            <div class="table-responsive">
              <table class="table table-striped" id="dataTable" >
                <thead>
                  <tr>
                    <th>菜品名称</th>
                    <th>所属种类</th>
                    <th>缩率图</th>
                    <th>价格</th>
                    <th>状态</th>
                    <th>操作</th>
                  </tr>
                </thead>
                <tbody>
                  <% @foods.each do |food| %>
                  <tr>
                    <td><%= food.name %></td>
                    <td><%= food.food_type.name %></td>
                    <td>
                      <%= image_tag food.attachment.url(:icon),width: 100,height: 100 %>
                    </td>
                    <td>
                      ￥<%= food.sell_price %>
                    </td>
                    <td>
                      <span class="label <%= if food.is_published then 'label-primary' else 'label-danger' end %>"><%= food.is_published? %></span>
                    </td>
                    <td>
                     <%= link_to "查看菜品","/restaurants/foods/#{food.id}",class:"btn btn-default" %>
                    <%= link_to "修改菜品","/restaurants/foods/#{food.id}/edit",class:"btn btn-info" %>
                    <%  if food.is_published %>
                      <%= link_to "下架菜品","/restaurants/foods/#{food.id}/unpublished",class:"btn btn-warning",method: :put,data:{confirm: '您确定要下架该菜品吗?'} %>
                    <% else %>
                      <%= link_to "上架菜品","/restaurants/foods/#{food.id}/published",class:"btn btn-success",method: :put,data:{confirm: '您确定要上架该菜品吗?'} %>
                    <% end %>
                    <%= link_to "删除菜品","/restaurants/foods/#{food.id}",method: :delete,class:"btn btn-danger",data:{confirm:"确定要删除吗?"} %>
                    </td>
                  </tr>
                  <% end %>
                </tbody>
              </table>
            </div>